<template>
	<view>
		<view class="notice">
			<view class="notice_nr" v-for="(item, index) in list" :key="index" @click="to_notice_detail(item.id)">
				<image class="notice_nr_img" src="/static/70.png" mode=""></image>
				<view class="notice_nr_box">
					<view class="notice_nr_box_title">{{ item.title }}</view>
					<view class="notice_nr_box_text">发布时间：{{ item.time }}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	const http = inject('$http')
	let id = ref(1)
	let list = ref([])

	const indexlist = async () => {
		await http.post('/srapi/yuangong/qbshishi', { id: id.value }).then((res) => {
			console.log('返回值', res)
			list.value = res.data
		})
	}

	onShow(() => {
		console.log('页面刷新')
	})
	onLoad((option) => {
		console.log('接收传参:', option)
		id.value = option.id
		indexlist()
	})
	const to_notice_detail = (id) => {
		uni.redirectTo({
			url: '/pages_A/notice_detail/notice_detail?id=' + id
		})
	}
</script>

<style lang="less" scoped>
	.notice {
		padding: 25rpx 30rpx;
		.notice_nr {
			background: #ffffff;
			border-radius: 12rpx;
			padding: 30rpx;
			margin-bottom: 18rpx;
			display: flex;
			justify-content: center;
			align-items: flex-start;
			.notice_nr_img {
				width: 29rpx;
				height: 32rpx;
				margin-right: 20rpx;
			}
			.notice_nr_box {
				flex: 1;
				.notice_nr_box_title {
					font-size: 28rpx;
					font-weight: 500;
					color: #000000;
					margin-bottom: 16rpx;
					line-height: 22rpx;
				}
				.notice_nr_box_text {
					font-size: 24rpx;
					font-weight: 500;
					color: #787878;
				}
			}
		}
	}

	//
</style>
